I have a module,ModuleA, that I want to read from that has two columns, c1 and c2. The first column contains an ID let's call it ModuleBID that I want to search and find in ModuleB, and the second column has another ID called ModuleCID that I want to search and find in ModuleC. When the matching Id's ModuleBID , and ModuleCID are found in ModuleB & ModuleC respectively I want to create a link between them. |
Re: open other modules in DXL
You will need the full path to module B and C; unless by chance they are in the same folder as module A and your DXL is running from within module A.
// Open module A, then run this code
Module mCurr = current
if (null mCurr or
type(mCurr) != "Formal" or
name(mCurr) != "Module!") {errorBox("Run from open moduleA"); halt}
string NameB = "/MyProject/MyFolder/ModuleB",
NameC = "/MyProject/MyOtherFolder/ModuleC"
Module modB = edit(NameB, false, false)
if (null modB) {errorBox("Cannot open " NameB); halt}
elseif(!isEdit(modB)) {errorBox("Cannot open " NameB " for edit"); close(modB); halt}
Module modC = read(NameC, false)
if (null modC) {errorBox("Cannot open " NameC); close(modB); halt}
// OK, here we go
|